<script type="text/html" template
        lay-url="{{ window.globalConfig.url_productsFields + '/' + layui.router().search.id }}"
        lay-done="layui.data.done(d);">
    <title>字段详情</title>

    <div class="layui-fluid">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-header">
                        <a href="javascript:history.back()"
                           class="layui-btn layui-btn-primary layui-btn-sm" id="goBack">返回上级</a>
                        {{ d.data.name || '' }}
                    </div>
                    <div class="layui-card-body">
                        <div class="layui-form" lay-filter="LAY-home-productsFields-listform"
                             id="LAY-home-productsFields-listform"
                             style="padding: 20px 30px 0 0;">
                            <div class="layui-form-item">
                                <label class="layui-form-label">字段名称</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="name" value="{{ d.data.name || '' }}"
                                           lay-verify="required"
                                           placeholder="请输入字段名称" autocomplete="off" class="layui-input"
                                    >
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label class="layui-form-label">是否显示</label>
                                <div class="layui-input-inline">
                                    <input type="checkbox" name="is_show" title="开启|关闭" value="1" lay-skin="switch"
                                           {{# if(d.data.is_show == undefined ){d.data.is_show = 1 } }}
                                           {{# if(d.data.is_show){ }}
                                           checked
                                           {{# } }}
                                    >
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label class="layui-form-label">排序</label>
                                <div class="layui-input-inline">
                                    <input type="number" name="sort" lay-affix="number" min="0"
                                           value="{{ d.data.sort | 0 }}"
                                           placeholder="请输入排序" autocomplete="off"
                                           class="layui-input">
                                </div>
                            </div>

                            <input type="hidden" name="id" value="{{ d.data.id || null }}">
                            <div class="layui-form-item">
                                <label class="layui-form-label"></label>
                                <div class="layui-input-inline">
                                    <input type="button" lay-submit
                                           lay-filter="LAY-home-productsFields-listform-submit"
                                           value="保存"
                                           class="layui-btn">
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</script>
<script src="res/modules/productsFields.js"></script>
